package com.lancoo.znbkxx.teacher.widget;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.PopupWindow;

import com.lancoo.znbkxx.teacher.R;

/**
 * 搜索popupwindow
 */
public class SearchPopupWindow extends PopupWindow {
    private Context context;
    private View mPopView;


    public SearchPopupWindow(Context context) {
        super(context);
        this.context = context;
        initView(context);
    }

    @Override
    public View getContentView() {
        return mPopView;
    }

    private void initView(Context context) {
        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mPopView = inflater.inflate(R.layout.view_search, null);
        this.setContentView(mPopView);
        this.setWidth(WindowManager.LayoutParams.MATCH_PARENT);
        this.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
        this.setOutsideTouchable(true);
        this.setBackgroundDrawable(new ColorDrawable(Color.WHITE));
        this.setFocusable(false);
    }
}
